﻿@model GameSchoolApplication.Models.Game

@{
    ViewBag.Title = "Breyta leik";
    if (GameSchoolApplication.Helper.MemberShip.BelongsTo(User.Identity.Name))
    {
        Layout = "~/Views/Shared/_TeacherLayout.cshtml";
    }
    else
    {
        Layout = "~/Views/Shared/_AdministratorLayout.cshtml";
    }
}
<section id="SingleMainContent">
<h2>Breyta leik</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend></legend>

        @Html.HiddenFor(model => model.GameId)

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.AuthorId)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.AuthorId)
            @Html.ValidationMessageFor(model => model.AuthorId)
        </div>

        <p>
            <input type="submit" value="Skrá" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Til baka í lista", "Index")
</div>
</section>